<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
            <%
	String path = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
	String basePath = path  + request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<link rel="stylesheet" href="layui/css/layui.css">
<script src="js/jquery.min.js"></script>
<script src="layui/layui.js"></script>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form class="layui-form" action="attendence/add" method="post">
  <div class="layui-form-item">
    <label class="layui-form-label">姓名</label>
    <div class="layui-input-block">
      <input type="text" name="staffname" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
    </div>
  </div>
 
  <div class="layui-form-item">
    <label class="layui-form-label">部门</label>
    <div class="layui-input-block">
      <select id="bumen" name="department.deptld" lay-verify="required">
       
      </select>
    </div>
  </div>
 
  <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <select name="sex" lay-verify="required">
        <option value="男">男</option>
        <option value="女">女</option>
        
      </select>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">签到时间</label>
    <div class="layui-input-block">
      <input type="text" id="qiandao" name="attendin" required  lay-verify="required" placeholder="请输入签到时间" autocomplete="off" class="layui-input">
    </div>
  </div>
  
   <div class="layui-form-item">
    <label class="layui-form-label">签退时间</label>
    <div class="layui-input-block">
      <input type="text" id="qiantui" name="attendout" required  lay-verify="required" placeholder="请输入签退时间" autocomplete="off" class="layui-input">
    </div>
  </div>

 <div class="layui-form-item">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <input type="text" name="remark" required  lay-verify="required" placeholder="请输入备注" autocomplete="off" class="layui-input">
    </div>
  </div>
 
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>
</body>
<script type="text/javascript">
$(function(){
	
	bumen();
})
layui.use(['form','laydate'],function(){
	
	layui.laydate.render({
		elem:"#qiandao",
		type:"time"
		
	})
	layui.laydate.render({
		elem:"#qiantui",
		type:"time"
		
	})
})

function bumen(){
	 $.get('attendence/bumen',function(data){
		 $.each(data,function(){
			$("<option></option>").val(this.deptld).text(this.deptname).appendTo("#bumen")
			 
		 });
		layui.form.render("select"); 
	 });
	
}
</script>
</html>